/*导入vue核心包*/
import Vue from 'vue';
/*导入App.vue的vue对象*/
import App from "./app.vue";
/*导入mint-ui*/
import MintUI from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(MintUI);
/*导入mui的css样式*/
import "../statics/mui/css/mui.css";
/*导入当前系统的全局样式*/
import "../statics/css/site.css";
/*将vue-router集成到该项目中*/
import vueRouter from 'vue-router';
Vue.use(vueRouter);
/*导入路由规则对应的对象*/
import home from './components/Home.vue';
import newslist from "./components/news/newslist.vue";
import newsinfo from "./components/news/newsinfo.vue";
import photolist from "./components/photo/photolist.vue";
import photoinfo from "./components/photo/photoinfo.vue";
import goodslist from "./components/goods/goodslist.vue";
import goodsinfo from "./components/goods/goodsinfo.vue";
import goodsdesc from "./components/goods/goodsdesc.vue";
import goodscomment from "./components/goods/goodscomment.vue";
import car from "./components/shopcar/car.vue";
/*定义路由规则*/
var router1=new vueRouter({
  routes:[
      {path:'/',redirect:'/home'},
      {path:'/home',component:home},
      {path:'/news/newslist',component:newslist},
      {path:'/news/newsinfo/:id',component:newsinfo},
      {path:'/photo/photolist',component:photolist},
      {path:'/photo/photoinfo/:id',component:photoinfo},
      {path:'/goods/goodslist',component:goodslist},
      {path:'/goods/goodsinfo/:id',component:goodsinfo},
      {path:'/goods/goodsdesc/:id',component:goodsdesc},
      {path:'/goods/goodscomment/:id',component:goodscomment},
      {path:'/shopcar/car',component:car}
  ]
});
// 定义一个全局过滤器实现日期的格式化
import moment from 'moment';
Vue.filter('datefmt',function(input,fmtstring){
//  使用momentjs这个日期格式化类库实现日的格式化功能
  return moment(input).format(fmtstring);
});
/*将vue-resource在vue中绑定，然后在vue对象上绑定$http就能使用ajax获取数据了*/
import vueResource from 'vue-resource';
Vue.use(vueResource);
// 使用图片预览组件
import VuePreview from 'vue-preview';
Vue.use(VuePreview);
new Vue({
  el:'#app',
  router:router1,
  render:c=>c(App)
})